#include "player.h"

Player::Player(QString newUsername, int newDifficulty, QString newCurMap, int newPosX, int newPosY, int newDirection, QList<Item*> *newInventory) :
    username(newUsername),
    difficulty(newDifficulty),
    curMap(newCurMap),
    posX(newPosX),
    posY(newPosY),
    direction(newDirection),
    inventory(newInventory)
{
}

Player::~Player() {
    while(!inventory->isEmpty()) delete inventory->takeFirst();
    delete inventory;
}

QString Player::getUsername() { return username; }
int Player::getDifficulty() { return difficulty; }
QString Player::getCurMap() { return curMap; }
int Player::getPosX() { return posX; }
int Player::getPosY() { return posY; }
int Player::getDirection() { return direction; }
QList<Item*>* Player::getInventory() { return inventory; }
void Player::setCurMap(QString newCurMap) { curMap = newCurMap; }
void Player::setPosX(int newPosX) { posX = newPosX; }
void Player::setPosY(int newPosY) { posY = newPosY; }
void Player::setDirection(int newDirection) { direction = newDirection; }
